package com.gitee.zhangchenyan.takin.service.client;

import java.lang.reflect.Proxy;

public class ServiceClient {

    public static <T> T create(Class<T> clazz) {
        ServiceClientInvocationHandler serviceClientInvocationHandler = new ServiceClientInvocationHandler();
        serviceClientInvocationHandler.setClazz(clazz);
        return (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz}, serviceClientInvocationHandler);
    }
}
